#ifndef QWINDOW_H
#define QWINDOW_H

#include <windows.h>

#include "qwidget.h"

#define WFLAG_NOWINDOW	1

class QWindow : public QWidget {
public:
	QWindow(QWidget *parent = 0, const char *name = 0,int wflags = 0);
	~QWindow();

	void show();
	void move(int x, int y);
	void resize(int width, int height);
	void setGeometry(int x, int y, int width, int height);
	void setCaption(const QString& caption);

	static void registerWindowHandle(HWND hwnd, QWindow *w);
	static void unregisterWindowHandle(HWND hwnd);
	static QWindow *findWindowByHandle(HWND hwnd);

	HWND hwnd;

private:
	static int wndCounter;
	char wndName[32];

	static LRESULT CALLBACK windowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

#endif // !QWINDOW_H
